﻿using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System.ComponentModel.DataAnnotations;


namespace LimaLims.Core.Entity.System
{
    /// <summary>
    /// 租户信息
    /// </summary>
    public class SysTenant : DEntityBase<long, MultiTenantDbContextLocator>, IEntitySeedData<SysTenant>
    {
        /// <summary>
        /// 公司名称
        /// </summary>
        [Comment("公司名称")]
        [Required, MaxLength(30)]
        public string Name { get; set; }

        /// <summary>
        /// 管理员名称
        /// </summary>
        [Comment("管理员名称")]
        [Required, MaxLength(20)]
        public string AdminName { get; set; }

        /// <summary>
        /// 电子邮箱
        /// </summary>
        [Comment("电子邮箱")]
        [MaxLength(50)]
        public string Email { get; set; }

        /// <summary>
        /// 电话
        /// </summary>
        [Comment("电话")]
        [MaxLength(20)]
        public string Phone { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [Comment("备注")]
        [MaxLength(1000)]
        public string Remark { get; set; }

        public IEnumerable<SysTenant> HasData(DbContext dbContext, Type dbContextLocator)
        {
            return new[]
            {
                new SysTenant
                {
                    Id=142307070918780,Name="默认租户", AdminName="DefaultAdmin",Email="1617032371@qq.com",Phone="138****0205", CreatedTime=DateTime.Now,Remark="默认租户"
                }
            };
        }
    }
}
